package main.Q1401_1500;

import java.util.HashSet;
import java.util.Set;

public class Q1451_1460 {
    public static void main(String[] args) {
        System.out.println("Question1451：");
        System.out.println("Question1452：");
        System.out.println("Question1453：");
        System.out.println("Question1454：");
        System.out.println("Question1455：");
        System.out.println("Question1456：定长子串中元音的最大数目");
        System.out.println(new Question1456().maxVowels("ibpbhixfiouhdljnjfflpapptrxgcomvnb", 33));
        System.out.println("Question1457：");
        System.out.println("Question1458：");
        System.out.println("Question1459：");
        System.out.println("Question1460：");
    }
}

class Question1456 {
    public int maxVowels(String s, int k) {
        Set<Character> set = new HashSet<>();
        char[] str = s.toCharArray();
        set.add('a');
        set.add('e');
        set.add('i');
        set.add('o');
        set.add('u');
        int max = 0, count = 0;
        int left = 0, right = k - 1;
        for (int i = 0; i <= right; i++) {
            if (set.contains(str[i])) count++;
        }
        max = count;
        left++;
        right++;
        while (right < str.length) {
            if (set.contains(str[right])) {
                count++;
            }
            if (set.contains(str[left - 1])) {
                count--;
            }
            left++;
            right++;
            max = Math.max(max, count);
        }
        return max;
    }
}